<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
    <title>注册</title>
    <script th:src="@{js/jquery-3.3.1.js}"></script>
</head>
<body>
<input type="button" value="注册" onclick="register();"/>
<script type="text/javascript">
    function register() {
        var path = "do_register";
        var user = {
            name:"徐方友",
            pwd:"123456",
        };
        $.ajax({
            url:path,
            data:user,
            type:"POST",
            success:function () {
                top.location="login"
            }
        });
    }
</script>
</body>
</html>